<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Search.aspx.cs"
    Inherits="AdventureWorks.Products.Search" %>

<%@ Register Src="~/DynamicData/Content/GridViewPager.ascx" TagName="GridViewPager"
    TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true" />
    <asp:ScriptManagerProxy runat="server" ID="ScriptManagerProxy1" />
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true"
        HeaderText="List of validation errors" />
    <asp:DynamicValidator runat="server" ID="GridViewValidator" ControlToValidate="GridView1"
        Display="None" />
    <br />
    <br />
    <asp:DynamicFilterForm ID="DynamicFilterForm1" runat="server" DataSourceID="GridDataSource">
        <FilterTemplate>
            <div>
                Search
            </div>
            <table>
                <tr>
                    <td>
                        Name:
                    </td>
                    <td>
                        <asp:DynamicFilterControl ID="DynamicFilterControl3" runat="server" DataField="Name"
                            FilterMode="Contains" />
                    </td>
                    <td>
                        Product Number:
                    </td>
                    <td>
                        <asp:DynamicFilterControl ID="DynamicFilterControl5" runat="server" DataField="ProductNumber"
                            FilterMode="Contains" />
                    </td>
                    <td rowspan="2" valign="top">
                        Product Model:
                    </td>
                    <td rowspan="2" valign="top">
                        <asp:DynamicFilterControl ID="DynamicFilterControl7" runat="server" DataField="ProductModel"
                            FilterMode="MultiSelect" />
                    </td>
                    <td rowspan="2" valign="top">
                        <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Search">Search</asp:LinkButton><br />
                        <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Clear">Clear</asp:LinkButton><br />
                        <asp:LinkButton ID="LinkButton3" runat="server" CommandName="Browse">Browse</asp:LinkButton>
                    </td>
                </tr>
                <tr>
                    <td>
                        List Price:
                    </td>
                    <td>
                        <asp:DynamicFilterControl ID="DynamicFilterControl1" runat="server" DataField="ListPrice"
                            FilterMode="Range" />
                    </td>
                    <td>
                        Category:
                    </td>
                    <td>
                        <asp:DynamicFilterControl ID="DynamicFilterControl2" runat="server" DataField="ProductCategory" />
                    </td>
                </tr>
            </table>
        </FilterTemplate>
    </asp:DynamicFilterForm>
    <br />
    <asp:GridView ID="GridView1" runat="server" DataSourceID="GridDataSource" AutoGenerateColumns="False"
        AutoGenerateSelectButton="False" AutoGenerateEditButton="False" AutoGenerateDeleteButton="False"
        AllowPaging="True" AllowSorting="True" EnableQueryStringSelection="True" CssClass="gridview"
        AlternatingRowStyle-CssClass="even">
        <Columns>
            <asp:TemplateField HeaderText="Name" SortExpression="Name">
                <ItemTemplate>
                    <asp:HyperLink runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "ProductId", "~/Products/Details.aspx?ProductId={0}") %>'>
                        <asp:DynamicControl DataField="Name" runat="server" />
                    </asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:DynamicField HeaderText="Product Category" DataField="ProductCategory" />
            <asp:DynamicField HeaderText="Product Model" DataField="ProductModel" />
            <asp:DynamicField HeaderText="Product Number" DataField="ProductNumber" />
            <asp:DynamicField HeaderText="Color" DataField="Color" />
            <asp:DynamicField HeaderText="Standard Cost" DataField="StandardCost" />
            <asp:DynamicField HeaderText="List Price" DataField="ListPrice" />
            <asp:DynamicField HeaderText="Size" DataField="Size" />
            <asp:DynamicField HeaderText="Weight" DataField="Weight" />
        </Columns>
        <PagerStyle CssClass="Footer" />
        <PagerTemplate>
            <asp:GridViewPager ID="GridViewPager1" runat="server" />
        </PagerTemplate>
        <EmptyDataTemplate>
            There are currently no items in this table.
        </EmptyDataTemplate>
    </asp:GridView>
    <asp:DynamicLinqDataSource ID="GridDataSource" runat="server" ContextTypeName="AdventureWorks.BusinessObjects.AdventureWorksDataContext"
        TableName="Products">
    </asp:DynamicLinqDataSource>
</asp:Content>
